/* Singleton Application Config */
function TCGConfig() {
	// The Singleton Instance
	var instance = this;
	
	// Private Config Settings
	var DEBUG = true;
	var REST_BASE		= prompt("Please enter the IP of the RESTful web service.", "192.168.1.203");
	var REST_CARD_IMG	= "/card/{}/image";
	var REST_PROP_IMG	= "/property/{}/image";
	
	// Public Access Methods
	this.isDebug = function() {
		return DEBUG;
	};
	
	this.getCardImagePath = function(cardId) {
		var path = "http://" + REST_BASE + ":9998" + REST_CARD_IMG;
		path = path.replace("{}", cardId);
		
		console.log("Config: " + path);
		
		return path;
	};
	
	this.getRestBasePath = function() {
		return "http://" + REST_BASE + ":9998";
	};
	
	this.getIP = function() {
		return REST_BASE;
	};
	
	this.getPropertyImagePath = function(propertyId) {
		var path = "http://" + REST_BASE + ":9998" + REST_PROP_IMG;
		path = path.replace("{}", propertyId);
		
		console.log("Config: " + path);
		
		return path;
	};
	
	console.log("Config loaded.");
	
	// rewrite the constructor
	TCGConfig = function () {
		return instance;
	};
}